package com.example.demo.vo

import com.example.demo.dbmodels.TDept
import io.swagger.annotations.ApiModelProperty
import java.time.LocalDateTime

class DeptVo {

    /**
     *  科室ID
     **/
    @ApiModelProperty("科室ID")
    var id: Int? = null
    /**
     *  病区代码
     **/
    @ApiModelProperty("病区代码")
    var district_code: String? = null
    /**
     *  科室编码
     **/
    @ApiModelProperty("科室编码")
    var code: String? = null
    /**
     *  科室名称
     **/
    @ApiModelProperty("科室名称")
    var name: String? = null
    /**
     *  科室英文
     **/
    @ApiModelProperty("科室名称")
    var ename: String? = null
    /**
     *  科室简称
     **/
    @ApiModelProperty("科室名称")
    var simple_name: String? = null
    /**
     *  科室类型
     **/
//    @ApiModelProperty("科室名称")
//    var type: String? = null
    /**
     *  简介
     **/
    @ApiModelProperty("简介")
    var intro: String? = null
    /**
     *  是否挂号科室;0-假； 1-真;
     **/
    @ApiModelProperty("是否挂号科室;0-假； 1-真;")
    var regdept_flag: Int? = null
    /**
     *  是否核算科室 0-假； 1-真;
     **/
    @ApiModelProperty("是否核算科室 0-假； 1-真;")
    var tatdept_flag: Int?= null
    /**
     *  特殊科室属性0 普通, 1 手术,  2 麻醉, 3 ICU,  4 CCU, C 产科,E急诊留观,T
     **/
    @ApiModelProperty(" 特殊科室属性0 普通, 1 手术,  2 麻醉, 3 ICU,  4 CCU, C 产科,E急诊留观,T")
    var dept_pro: String? = null
    /**
     *  有效性标志;1在用 0 停用 2 废弃
     **/
    @ApiModelProperty("有效性标志;1在用 0 停用 2 废弃")
    var status: Int?= null
    /**
     *  科室负责人
     **/
    @ApiModelProperty("科室负责人")
    var principal: String? = null
    /**
     *  科室电话
     **/
    @ApiModelProperty("科室电话")
    var phone: String? = null
    /**
     *  备注
     **/
    @ApiModelProperty("备注")
    var remark: String? = null
    /**
     *  操作时间
     **/
    @ApiModelProperty("操作时间")
    var operate_time: LocalDateTime?= null
    /**
     *  更新时间
     **/
    @ApiModelProperty("更新时间")
    var update_time: LocalDateTime?= null
    /**
     *  更新人
     **/
    @ApiModelProperty("更新人")
    var update_by: Int?= null
    /**
     *  删除标记
     **/
    @ApiModelProperty("删除标记")
    var is_del: Boolean?= null

    fun getVo(table: TDept): DeptVo {
        table.let {
            val data = DeptVo()
            data.id = it.id
            data.intro= it.intro
            data.code = it.code
            data.dept_pro = it.dept_pro
            data.district_code = it.district_code
            data.ename = it.ename
            data.district_code =it.district_code
            data.is_del = it.is_del
            data.name= it.name
            data.operate_time = it.operate_time
            data.phone = it.phone
            data.principal = it.principal
            data.regdept_flag = it.regdept_flag
            data.remark = it.remark
            data.simple_name = it.simple_name
            data.status = it.status
            data.tatdept_flag = it.tatdept_flag
//            data.type = it.type
            data.update_by = it.update_by
            data.update_time = it.update_time

            return data

        }
    }

    fun getListVo(table: List<TDept>): List<DeptVo> {
        table.let {
            val deptVos = mutableListOf<DeptVo>()
            table.forEach {
                val data = DeptVo()
                data.id = it.id
                data.intro= it.intro
                data.code = it.code
                data.dept_pro = it.dept_pro
                data.district_code = it.district_code
                data.ename = it.ename
                data.district_code =it.district_code
                data.is_del = it.is_del
                data.name= it.name
                data.operate_time = it.operate_time
                data.phone = it.phone
                data.principal = it.principal
                data.regdept_flag = it.regdept_flag
                data.remark = it.remark
                data.simple_name = it.simple_name
                data.status = it.status
                data.tatdept_flag = it.tatdept_flag
//                data.type = it.type
                data.update_by = it.update_by
                data.update_time = it.update_time

                deptVos.add(data)

            }
            return deptVos
        }
    }
}